 /* To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jhave.client;

import javax.swing.*;
import java.util.*;
import java.awt.*;
import org.jdom.Element;

/**
 *
 * @author bosmak40
 */
public class ClickingArea_Label_Line_Element extends JHAVE_Abstract_ClickingArea_Element implements JHAVE_Element{


    ClickingArea_Label_Line_Element(Element child, JPanel returnedPanel, Vector components, int mode, boolean clickingArea){
        super(child, returnedPanel, components, mode, clickingArea);
    }


     /**
     * Adds ClickArea label line to panel and to components vector.
     *
     */
    public void addElementToPanel(){
        this.returnedPanel.add( new JLabel( child.getText() ) );
        if(child.getText().indexOf("standard")!=-1)
          this.mode=-1;
        else if(child.getText().indexOf("free")!=-1)
          this.mode=0;
        else if(child.getText().indexOf("Exercise")!=-1) {
          this.mode=Integer.parseInt(child.getText().substring(child.getText().length()-2,child.getText().length()-1));
        }
          else if(child.getText().indexOf("Choose")!=-1)
          this.mode=-2;
        this.clickingArea=true;
    }

}